#include <stdio.h>
/*
* II_1.c
*
*  Created on: April, 9, 2009
*      Author: yimingliu@fudan.edu.cn
*/

/**
*precondition:	m > n
*/
int gcd(int m,int n)
{
	int r = m%n;   
    while(r!=0)
	{   
        m = n;   
        n = r;   
        r = m%n;   
    };
	return n;
}

void funII_1()
{
	int m,n,r;
	scanf("%d",&m);
	scanf("%d",&n);
	if(m<n)
	{
		r=gcd(n,m);
	}
	else
	{
		r=gcd(m,n);
	}
	printf("%d",r);
}

